# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=py3-bite-parser
pkgver=0.2.5
pkgrel=0
pkgdesc="Asynchronous parser taking incremental bites out of your byte input stream"
url="https://github.com/jgosmann/bite-parser"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-wheel
	"
checkdepends="
	py3-pytest-asyncio
	py3-pytest-forked
	py3-pytest-xdist
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jgosmann/bite-parser/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/bite-parser-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto --forked
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -r "$pkgdir"/usr/lib/python*/site-packages/bite/tests
}

sha512sums="
689233266c6d9d71b6e0956695913b3c6f04b0fdb5f9c69c541f6a14bec1883d533ce495b9f9bcc9ccb6a3f6a35d0a64c8d29708d36cd7e67dd22cd1e985cc20  py3-bite-parser-0.2.5.tar.gz
"
